package aop03;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class ServiceExceptionAdvice implements ThrowsAdvice {

    // public void afterThrowing(Exception e){
    //     System.out.println("exception");
    // }
    //
    // public void afterThrowing(SomeException e){
    //     System.out.println("someException");
    // }
    //
    // public void afterThrowing(OtherException e){
    //     System.out.println("otherException");
    // }

    public void afterThrowing(Method method, Object[] args, Object target, Exception e){
        System.out.println(target.getClass().getName()+"类"+method.getName()+"方法跑出了"+e+"异常");
    }
}
